#include"pipe.hpp"

int main()
{
    int wfd=open(NAMEPIPE,O_WRONLY);
    if(wfd<0) exit(-1);
    char buf[1024];
    while(true)
    {
        cout<<"Please say# ";
        fgets(buf,sizeof(buf),stdin);
        if(strlen(buf)>0) buf[strlen(buf)-1]=0;
        ssize_t s=write(wfd,buf,strlen(buf));
        assert(s=strlen(buf));
        (void)s;
    }
    close(wfd);
    return 0;
}